Optimal. Leaf size=167 \[ -\frac{(2 a B+A b) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} d}+\frac{\sqrt{a-i b} (B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d}-\frac{\sqrt{a+i b} (-B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d}-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.51638, antiderivative size = 167, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 7, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.212, Rules used = {3608, 3653, 3539, 3537, 63, 208, 3634} \[ -\frac{(2 a B+A b) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} d}+\frac{\sqrt{a-i b} (B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d}-\frac{\sqrt{a+i b} (-B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d}-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3608
Rule 3653
Rule 3539
Rule 3537
Rule 63
Rule 208
Rule 3634
Rubi steps
\begin{align*} \int \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx &=-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{d}-\int \frac{\cot (c+d x) \left (\frac{1}{2} (-A b-2 a B)+(a A-b B) \tan (c+d x)+\frac{1}{2} A b \tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx\\ &=-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{d}-\frac{1}{2} (-A b-2 a B) \int \frac{\cot (c+d x) \left (1+\tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx-\int \frac{a A-b B+(A b+a B) \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx\\ &=-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{d}-\frac{1}{2} ((a-i b) (A-i B)) \int \frac{1+i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx-\frac{1}{2} ((a+i b) (A+i B)) \int \frac{1-i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx+\frac{(A b+2 a B) \operatorname{Subst}\left (\int \frac{1}{x \sqrt{a+b x}} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{d}-\frac{(i (a-i b) (A-i B)) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a-i b x}} \, dx,x,i \tan (c+d x)\right )}{2 d}+\frac{((i a-b) (A+i B)) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a+i b x}} \, dx,x,-i \tan (c+d x)\right )}{2 d}+\frac{(A b+2 a B) \operatorname{Subst}\left (\int \frac{1}{-\frac{a}{b}+\frac{x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}\\ &=-\frac{(A b+2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} d}-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{d}+\frac{((a-i b) (A-i B)) \operatorname{Subst}\left (\int \frac{1}{-1-\frac{i a}{b}+\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}+\frac{((a+i b) (A+i B)) \operatorname{Subst}\left (\int \frac{1}{-1+\frac{i a}{b}-\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}\\ &=-\frac{(A b+2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} d}+\frac{\sqrt{a-i b} (i A+B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d}-\frac{\sqrt{a+i b} (i A-B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d}-\frac{A \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{d}\\ \end{align*}
Mathematica [A] time = 2.33061, size = 235, normalized size = 1.41 \[ \frac{\frac{\frac{\left (A \left (a \sqrt{-b^2}+b^2\right )+b B \left (a-\sqrt{-b^2}\right )\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-\sqrt{-b^2}}}\right )}{\sqrt{a-\sqrt{-b^2}}}+\frac{\left (A \left (b^2-a \sqrt{-b^2}\right )+b B \left (a+\sqrt{-b^2}\right )\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+\sqrt{-b^2}}}\right )}{\sqrt{a+\sqrt{-b^2}}}-A b \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{b}-\frac{(2 a B+A b) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a}}}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 1.578, size = 50548, normalized size = 302.7 \begin{align*} \text{output too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (A + B \tan{\left (c + d x \right )}\right ) \sqrt{a + b \tan{\left (c + d x \right )}} \cot ^{2}{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]